package com.kuang.service.impl;

import com.kuang.dao.BlogMapper;
import com.kuang.pojo.Blog;
import com.kuang.pojo.VoBlog;
import com.kuang.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl implements BlogService {
    @Autowired
    private BlogMapper blogMapper;

    @Override
    public List<Blog> selectAllBlog() {
        return blogMapper.selectAllBlog();
    }

    @Override
    public int insertBlog(Blog blog) {
        return blogMapper.insertBlog(blog);
    }

    @Override
    public Blog selectBlogId() {
        return blogMapper.selectBlogId();
    }

    @Override
    public int deleteblog(Integer blogid) {
        return blogMapper.deleteblog(blogid);
    }

    @Override
    public Blog selectBlogById(Integer blogid) {
        return blogMapper.selectBlogById(blogid);
    }

    @Override
    public int countBlog() {
        return blogMapper.countBlog();
    }

    @Override
    public List<Blog> selectBlogRecommend() {
        return blogMapper.selectBlogRecommend();
    }

    @Override
    public List<Blog> selectAllSiteIndexBlog() {
        return blogMapper.selectAllSiteIndexBlog();
    }

    @Override
    public int countBlogPublished() {
        return blogMapper.countBlogPublished();
    }

    @Override
    public int updateBlogById(Blog blog) {
        return blogMapper.updateBlogById(blog);
    }

    @Override
    public List<VoBlog> selectAllBlogCountGroupTypeId() {
        return blogMapper.selectAllBlogCountGroupTypeId();
    }

    @Override
    public List<Blog> selectAllBlogByTypeId(Integer typeid) {
        return blogMapper.selectAllBlogByTypeId(typeid);
    }

    @Override
    public int updateBlogTypeIdByTypeId(Integer typeid) {
        return blogMapper.updateBlogTypeIdByTypeId(typeid);
    }

    @Override
    public Blog selectAllBlogByMiddleBlogId(Integer blogid) {
        return blogMapper.selectAllBlogByMiddleBlogId(blogid);
    }

    @Override
    public List<String> selectGroupYearMonth() {
        return blogMapper.selectGroupYearMonth();
    }

    @Override
    public List<Blog> selectBlogByYear(String year) {
        return blogMapper.selectBlogByYear(year);
    }

    @Override
    public List<Blog> selectPageSiteIndexBlog(Integer pageindex, Integer pagesize) {
        return blogMapper.selectPageSiteIndexBlog(pageindex, pagesize);
    }

    @Override
    public List<Blog> selectPageSiteIndexBlogSearch(Integer pageindex, Integer pagesize, String keywords, Integer typeid) {
        return blogMapper.selectPageSiteIndexBlogSearch(pageindex, pagesize, keywords, typeid);
    }

    @Override
    public int selectPageSiteIndexBlogSearchCount(Integer pageindex, Integer pagesize, String keywords, Integer typeid) {
        return blogMapper.selectPageSiteIndexBlogSearchCount(pageindex, pagesize, keywords, typeid);
    }

    @Override
    public int updateBlogViews(Integer blogid) {
        return blogMapper.updateBlogViews(blogid);
    }

    @Override
    public List<Blog> selectBlogByBlogId(Integer blogid) {
        return blogMapper.selectBlogByBlogId(blogid);
    }
//
//    @Override
//    public int deleteByTypeId(Integer typeid) {
//        return blogMapper.deleteByTypeId(typeid);
//    }
}
